package com.yunxi.service.localService.impl.sto;

import com.yunxi.core.service.ServiceImplPlus;
import com.yunxi.core.util.BeanTools;
import com.yunxi.dao.sto.PartnerFinanceRelationMapper;
import com.yunxi.model.sto.PartnerFinanceRelation;
import com.yunxi.service.localService.sto.PartnerFinanceRelationService;
import com.yunxi.sto.pojo.PartnerFinanceRelationAccountVO;
import com.yunxi.sto.pojo.PartnerFinanceRelationInfoVO;
import com.yunxi.sto.pojo.PartnerFinanceRelationVO;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 渠道商融资机构关系 服务实现类
 * </p>
 *
 * @author caoYong
 * @since 2019-09-17
 */
@Service
public class PartnerFinanceRelationServiceImpl extends ServiceImplPlus<PartnerFinanceRelationMapper, PartnerFinanceRelation> implements PartnerFinanceRelationService {

    @Override
    public List<PartnerFinanceRelationVO> export(PartnerFinanceRelationVO partnerFinanceRelationVO) {
        Map map = BeanTools.bean2map(partnerFinanceRelationVO);
        List<PartnerFinanceRelationVO> list = baseMapper.queryByList(map);
        return list;
    }

    /**
     * 根据VIN查询融资机构信息
     * @param vin
     * @return
     */
    @Override
    public List<PartnerFinanceRelationInfoVO> listByVin(String vin) {
        return baseMapper.listByVin(vin);
    }

    /**
     * 获取有效付款方式
     * @return
     */
    @Override
    public List<PartnerFinanceRelationAccountVO> accountType() {
        return baseMapper.accountType();
    }

    /**
     * 根据渠道名称查询代码
     * @param partnerName
     * @return
     */
    @Override
    public String queryPartnerCodeByName(String partnerName) {
        return baseMapper.queryPartnerCodeByName(partnerName);
    }
}
